#ifndef __357436BD_8380_4b09_B497_D09973F85F65__
#define __357436BD_8380_4b09_B497_D09973F85F65__

#include "../import/head.h"
#include "../tools/head.h"

/////////////////////////////////////////////////////////////////////////////////////////
// 

namespace xos
{
    // 
    // time_impl
    // 
    class time_impl : public xos_stl::mem_pool_item< time_impl, thread_lock >,
        public i_time
    {
    public:
        time_impl();
        ~time_impl();

    protected:
        struct timeval m_tmval;
        struct tm m_tm;

    public:
        int init();
        int term();

    public:
        // 
        // calculate time difference. unit : 1 / 1000 second
        // 
        int diffrent( i_time * pLastTime, xos_u32 * lpulDif );

        // 
        // get time details
        // 
        int get_milli_second();
        int get_year();
        int get_month();
        int get_day();
        int get_hour();
        int get_minute();
        int get_second();

        // 
        // update time
        // 
        int get_time();

        // 
        // release
        // 
        int release();
    };
} // xos

#endif // __357436BD_8380_4b09_B497_D09973F85F65__
